# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsTextSentimentEvaluationMetrics do
  @moduledoc """
  Model evaluation metrics for text sentiment problems.

  ## Attributes

  *   `confusionMatrix` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsConfusionMatrix.t`, *default:* `nil`) - Confusion matrix of the evaluation. Only set for ModelEvaluations, not for ModelEvaluationSlices.
  *   `f1Score` (*type:* `number()`, *default:* `nil`) - The harmonic mean of recall and precision.
  *   `linearKappa` (*type:* `number()`, *default:* `nil`) - Linear weighted kappa. Only set for ModelEvaluations, not for ModelEvaluationSlices.
  *   `meanAbsoluteError` (*type:* `number()`, *default:* `nil`) - Mean absolute error. Only set for ModelEvaluations, not for ModelEvaluationSlices.
  *   `meanSquaredError` (*type:* `number()`, *default:* `nil`) - Mean squared error. Only set for ModelEvaluations, not for ModelEvaluationSlices.
  *   `precision` (*type:* `number()`, *default:* `nil`) - Precision.
  *   `quadraticKappa` (*type:* `number()`, *default:* `nil`) - Quadratic weighted kappa. Only set for ModelEvaluations, not for ModelEvaluationSlices.
  *   `recall` (*type:* `number()`, *default:* `nil`) - Recall.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :confusionMatrix =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsConfusionMatrix.t()
            | nil,
          :f1Score => number() | nil,
          :linearKappa => number() | nil,
          :meanAbsoluteError => number() | nil,
          :meanSquaredError => number() | nil,
          :precision => number() | nil,
          :quadraticKappa => number() | nil,
          :recall => number() | nil
        }

  field(:confusionMatrix,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsConfusionMatrix
  )

  field(:f1Score)
  field(:linearKappa)
  field(:meanAbsoluteError)
  field(:meanSquaredError)
  field(:precision)
  field(:quadraticKappa)
  field(:recall)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsTextSentimentEvaluationMetrics do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsTextSentimentEvaluationMetrics.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsTextSentimentEvaluationMetrics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
